//在这里造数据数据
import Mock from 'mockjs'
import { param2Obj } from '../../utils/mUtils'
// @ts-ignore
let List = []
for (var i = 0; i < 400; i++) {
    List.push({//这里的字段跟From里的数据的字段要保持一致  从mockjs复制的数据
        id: i + 1,
        key: i,
        zt: '已收费',
        type: '处方开立',
        address: 10030,
        tags: Mock.mock('@cname'),
        action: '全科',
        doctor: '王冕',
        youhui: 210,
        yingshou: 10,
        shishou: 200,
        yibao: 50,
        huiyuan: 150,
        xianj: 0,
        zhifub: 0,
        wx: 0,
        yhk: 0,
        sfrq: Mock.mock('@datetime'),
        sfy: '王冕',
        caozuo: '查看详情',
    })
}
export default {
    gettongj: (config: any) => {
        //@ts-ignore
        const { tags, page, pageSize } = param2Obj(config.url)
        console.log('config', tags, page, pageSize);

        //在这个里面可以放逻辑代码
        //参数name负责搜索功能   page.pageSize负责分页功能
        //@ts-ignore
        const newList = List.filter(item => {
            //@ts-ignore
            return item.tags.indexOf(tags) != -1
        })
        return {
            code: 200,
            msg: '成功',
            // @ts-ignore
            data: newList
        }
    }
}